<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="install/index/head :: header('DS-CMS系统安装')" />
</head>
<body>
<style type="text/css">
    .layui-table td, .layui-table th{text-align:left;}
    .layui-table tbody tr.no{background-color:#f00;color:#fff;}
</style>
<th:block th:include="install/index/head :: headerbody" />

<div class="install-box">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>运行环境检测</legend>
    </fieldset>
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th>当前环境</th>
            <th>当前信息</th>
        </tr>
        </thead>
        <tbody>
            <tr class="ok" th:each="map:${nnv}">
                <th th:text="${map.key}" ></th>
                <th th:text="${map.value}" ></th>
            </tr>
        </tbody>
    </table>
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th>目录/文件</th>
            <th>所需权限</th>
            <th>当前权限</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="dir:${data}" th:class="${dir[4]}">
            <td th:text="${dir[1]}"></td>
            <td th:text="${dir[2]}"></td>
            <td th:text="${dir[3]}"></td>
        </tr>
        </tbody>
    </table>

    <fieldset class="layui-elem-field layui-field-title">
        <legend>数据库选择</legend>
    </fieldset>
    <blockquote class="layui-elem-quote">对于数据多的可以选择MYSQL，少量数据选择SQLLITE</blockquote>
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">数据库类型</label>
            <div>
                <input type="radio" name="dbType" value="1" title="SQLITE" checked>
                <input type="radio" name="dbType" value="0" title="MYSQL">
            </div>
        </div>
    </form>



    <div class="step-btns">
        <a href="?index" class="layui-btn layui-btn-primary layui-btn-big fl">返回上一步</a>

<!--        <a href="?step=3" class="layui-btn layui-btn-big layui-btn-normal fr" >进行下一步</a>-->
        <a href="javascript:void(0);" class="layui-btn layui-btn-big layui-btn-normal fr btn"   onclick="next()">进行下一步</a>
<!--        <a target="_blank" href="#" class="layui-btn layui-btn-big layui-btn-danger fr">常见问题解决办法</a>-->
    </div>
</div>

<th:block th:include="install/index/foot :: foot" />
<script type="text/javascript">
    var test=0;
    layui.define(['element', 'form'], function(exports) {

    });


    function getValue(){
        var radio = document.getElementsByName("dbType");
        for (i=0; i<radio.length; i++) {
            if (radio[i].checked) {
                return radio[i].value
            }
        }
    }

    function next(){
        window.location.href="?step=3&dbType="+getValue()
    }
</script>


</body>

</html>

